package com.junzhiit.nengji.shop.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum ShopHistoryType {
	
	VIEW(0,"浏览"),
	SHARE(1,"分享"),
	VISIT(2,"分享(访问)");
	
	private Integer value;
	
	private String text;

	private ShopHistoryType(Integer value,String text) {
		this.value = value;
		this.text = text;
	}

	public int toIntValue() {
		return this.value;
	}
	
	public String toStringText() {
		return this.text;
	}

	public static ShopHistoryType toType(int value) {
		if (VIEW.value == value) {
			return VIEW;
		} else if(SHARE.value == value){
			return SHARE;
		} else if(VISIT.value == value){
			return VISIT;
		} else {
			throw new InvalidArgumentException("Unknown PayHistoryType[" + value + "].");
		}
	}
}
